import Vue from "vue";
import Vant from "vant";
import "vant/lib/index.css";

import App from "./App.vue";
import router from "./router";
import { serverUrl } from "./utils/request";
Vue.use(Vant); //使用组件

Vue.config.productionTip = false;

//全局过滤器 图片
Vue.filter("dalImg", (url) => {
  if (url) {
    if (url.startsWith("http")) {
      return url;
    }
    return serverUrl + url;
  } else {
    return "https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/74a51ccb0237755ef3ad7021a6e6d43c.png?thumb=1&w=1226&h=460&f=webp&q=90";
  }
});
new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
